package com.xgf.common.xgfcommon.result.code;

import com.xgf.common.xgfcommon.result.ResponseBo;
import com.xgf.common.xgfcommon.utils.StringUtils;

public enum ResultEnum
{
    
    SUCCESS("0", "成功"),
    FAIL("9999", "失败"),
    ERRORFAIL("9990", "系统异常"),
    SIGN_EMPTY("1100", "签名为空"),
    SIGN_ERROR("1101", "验签信息错误"),
    LACK_ERROR("1202", "缺少必填字段"),
    PUSH_ERROR("1204", "推送消息解析失败"),
    TIMESTAMP_ERROR("1205", "时间戳格式有误"),
    MANY_ERROR("1206", "物流轨迹数超过阈值"),
    UNKNOWN_ERROR("1207", "未知异常"),
    FREQUENCY_LIMIT_ERROR("1208", "超过调用频率限制"),
    ANTH_ERROR("1209", "用户没有授权此接口"),
    MAINTAIN_ERROR("1210", "当前接口系统维护，暂时下线，请稍后再试"),
    NOT_SUBSCRIBED_ERROR("1302", "此运单号尚未订阅")
    
    ;
    private String reasonCode;
    
    private String reasonName;
    
    
    
    
    public static ResponseBo<Object> downgrade() {
    	return  ResponseBo.setData(ResultEnum.FREQUENCY_LIMIT_ERROR);
    }
    
    

    private ResultEnum(ResultEnum resultEnum) {
    	
    	 ResponseBo<Object> build = ResponseBo.build(resultEnum);
    	 reasonCode = StringUtils.valueOf(build.get(ResponseBo.CODE));
    	 reasonName = StringUtils.valueOf(build.get(ResponseBo.MSG));
    	 
	}



	public String getReasonCode()
    {
        return reasonCode;
    }

    public void setReasonCode(String reasonCode)
    {
        this.reasonCode = reasonCode;
    }

    public String getReasonName()
    {
        return reasonName;
    }

    public void setReasonName(String reasonName)
    {
        this.reasonName = reasonName;
    }

    private ResultEnum(String reasonCode, String reasonName)
    {
        this.reasonCode = reasonCode;
        this.reasonName = reasonName;
    }

    
    
    
    
}
